<template>
	<u-sticky bgColor="#fff" :offsetTop="offsetTop">
	<view>
		<view class="nt-tabs">
			<view class="nt-tabs-container" :class="{ 'no-more': !showMore }">
				<u-tabs 
					:list="list" 
					:activeStyle="activeStyle" 
					:inactiveStyle="inactiveStyle"
					:current="current"
					@click="clickTab"
					v-bind="$attrs"
				></u-tabs>
			</view>
			<view class="nt-tabs-more" v-if="showMore">更多</view>
		</view>
		<!-- <view class="nt-tabs-gap"></view> -->
		
	</view>
	</u-sticky>
</template>

<script>
import { mapGetters } from "vuex"
export default {
	props: {
		list: {
			type: Array,
			default: () => []
		},
		showMore: {
			type: Boolean,
			default: true
		},
		offsetTop: {
			type: Number,
			default: 0
		},
		current: {
			type: Number,
			default: 0
		},
		loading: {
			type: Boolean,
			default: false
		}
	},
	computed: {
		...mapGetters(['theme'])
	},
	data() {
		return {
			activeStyle: {
				color: "#2D7FFD",
				fontSize: '32rpx',
			},
			inactiveStyle: {
				color: '#666',
				fontSize: '26rpx'
			}
		}
	},
	methods: {
		change() {
			
		},
		clickTab(e){
			this.$emit('click', e)
		}
	}
}
</script>

<style lang="scss" scoped>
.nt-tabs{
	height: 100rpx;
	display:flex;
	align-items: center;
	justify-content: space-between;
	// position: fixed;
	top:0;
	left: 0;
	right: 0;
	z-index: 9;
	background:#fff;
	&-gap{
		height: 100rpx;
	}
	&-container{
		width: calc(100% - 80rpx);
		&.no-more{
			width: 100%;
		}
		/deep/.u-tabs__wrapper__nav__line{
			display:none;
		}
	}
	&-more{
		width: 80rpx;
		font-size: 26rpx;
		color: #333;
		box-shadow: -10rpx 0 10rpx rgba(0,0,0,0.1);
		height: 100%;
		display:flex;
		align-items: center;
		justify-content: center;
	}
}
</style>